<html>
 <head>
 
 <script type="text/javascript" src="<?php echo MAIN_URL;?>js/coursesyllabusdetails.js"></script>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script src="<?php echo MAIN_URL;?>js/easypaginate.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<?php echo MAIN_URL;?>css/style.css" type="text/css" rel="stylesheet">
<link href="<?php echo MAIN_URL;?>css/paging.css" type="text/css" rel="stylesheet">
<link rel="icon" type="image/ico" href="<?php echo MAIN_URL;?>images/favicon.ico"></link> 

    <link rel="stylesheet" href="<?php echo MAIN_URL;?>css/style1.css" type="text/css" />
	<script type="text/javascript" src="<?php echo MAIN_URL;?>js/jquery-1.3.1.min.js"></script>
	<script type="text/javascript" src="<?php echo MAIN_URL;?>js/jquery.tablesorter.js"></script>
	<script type="text/javascript" src="<?php echo MAIN_URL;?>js/jquery.tablesorter.pager.js"></script>
 
     <script type="text/Javascript">
    $(document).ready(function(){ 
	  
              $("#r_button").click(function() {	
				   $(".errors").hide();
        });
 $("#s_button").click(function() {
			   
                $(".errors").hide();
                 
				var studentid=$("#studentlistcombo").val();
				 

                    var counter=0;
					var assignmentarray=new Array();
              $('#insured_list input[type="button"]:click').each(function(){
                      
					 
					 var $row = $(this).parents('tr'); 
                     var assignment=new Array();  
                         assignment[0]=$row.find('td:eq(0)').html();       
                

                     assignmentarray[counter]=assignment;

                    counter++;
					
					 
                });
              
				if(counter==0)  
			    {
					 
                  $("#questionError").show();
				   return false;
			    }
              if(studentid=="-1")
			   {
              $("#studentError").show();
			   return false;
			   }

  




assignassignment(studentid);
      
});

$("#option_multi").change(function() {	
 
 var option_multi=$("#option_multi").val();
 if(option_multi!="-1")
	{
	 $("#questions").html("");
	  $(".errors").hide();
	}

});


$("#asscourse_combo").change(function() {	
					
			    $("#chapter_names").html("");
				 
				$("#assigments").html("");
			     var courseid=$("#asscourse_combo").val();
				  
				 loadassignmentchangeandstudent(courseid,'chapter_names','studentlist');
          		 
				  });
			 });

 </script>
 </head>

<body>

<div style="height: 60px; width:100px" >
           <label id="studentError" style="display:none; height: 20px; width: 400px; color: red; font-size: 16px;" class="errors">Select at least one student
           </label>
           
		    
           <label id="questionError" style="display:none; color:red; height: 20px; width: 400px; color: red; font-size: 16px;" class="errors">Assign at least one question
           </label>
		   <label id="option_multierror" style="display:none; color:red; height: 20px; width: 400px; color: red; font-size: 16px;" class="errors">Select Question is Multiple answer or not
           </label>
           </div> 
 



 <div id="multiplechoice">
          <p>Select Type :
		  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		  <select align= "right" class="input" name="option_multi" id="option_multi">
              <option value="-1" selected>--Select Option--</option>
			  <option value="0" > Single Choice</option>
			  <option value="1" > Muliple Choice</option>
		   </select></p>
           </div>


Select Course :
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<select align= "right" class="input" name="course_combo" id="asscourse_combo">
 
<option value="-1" selected> 
<?php
 
if($course_details!=""){
 
echo "--Select Course--";
foreach ($course_details->result() as $row)
            {
	 print("<option value=\"{$row->id}\">{$row->courseName}</option>");
echo"<br>";
      }}
?>
	  </option>
	  </select></p>
 <p> <div id="chapter_names" style="height: 20px; width: 400px;"></div></p>
 
 <br><br><br>
 <p><div id="studentlist"></div></p>

 <br>
  <p><div id="assigments"></div></p>

<div id="pager" class="pager" style="display:none">
	<form>
		<img src="<?php echo MAIN_URL;?>images/first.png" class="first"/>
		<img src="<?php echo MAIN_URL;?>images/prev.png" class="prev"/>
		<input type="text" class="pagedisplay" style="height: 20px; margin: 2px 10px 20px 12px; padding: 1px; width: 60px;"/>
		<img src="<?php echo MAIN_URL;?>images/next.png" class="next"/>
		<img src="<?php echo MAIN_URL;?>images/last.png" class="last"/>
		<select class="pagesize">
			<option selected="selected" value="5">5</option>
			<option  value="20">20</option>
			<option value="30">30</option>
			<option value="40">40</option>
		</select>
            <div style="height:10px;width:10px;">

             <input value="Reset" type="reset" id="r_button" style="margin: 1px -60px -20pt -1pt;">
		    <input value="Submit" type="button" id="s_button" style="background: none repeat scroll 0 0 #04739D;
    border: 2px solid #27ABDD;
    color: #FFFFFF;
    float: right;
    margin: 23px -172px 0 0;
    outline: medium none;
    padding: 5px 10px; margin: 1px -200px -20pt -1pt;">
	</div></form>
</div>

</body>
</html>